<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	
	<title>Cross-Domain Post Form Test</title>
	
	<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>
   	
	<style type="text/css">
		#page-wrap {
			margin: 0 auto;
			width: 700px;
		}
		
		 #content { background: #eee; padding: 10px; width: 450px; font-size: 15px; }
	</style>
</head>
<body>
	<div id="page-wrap">
    
	<h2>Example 2: Post form and fetch result</h2>
	<p>Form below is dynamically generated using document.write. Script that processes form is located on remote server.
		When submited using hidden iframe result of script is injected into dom after "Form result".
	</p>
	<p>
		<script type="text/javascript">
			// dynamically create form
			document.write('<form id="test_frm_id" name="test_frm_id" style="border: 1px solid #ccc; padding: 10px;">' +
						'<label>Insert your name here:<Input type="text" name="name" id="name" value=""/></label>' + 
						'<input type="submit" name="submit" value="submit"/></form>');
		</script>
	</p>
	<div id="form_result"><p>Form result:</p></div>
	
	<script src="jquery.crossdomain.data.js" type="text/javascript"></script>
	
	<script type="text/javascript">
		$.postFormRemote(
			function(data){
				$("#form_result").append( data );
			},
			'test_frm_id', 'http://cross.com/wordpress/cross/form.php', 'post'
		);
	</script>
	
	</div>
</body>

</html>